<!DOCTYPE html>
<html>
<head>
    <title>MES系统仪表板</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        body { 
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
            margin: 0; 
            padding: 0;
            background-color: #f5f5f5;
        }
        .header { 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
            color: white; 
            padding: 30px; 
            text-align: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header h1 { margin: 0; font-size: 2.5em; }
        .header p { margin: 10px 0 0 0; opacity: 0.9; }
        .container { max-width: 1200px; margin: 0 auto; padding: 20px; }
        .stats { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
            gap: 20px; 
            margin: 30px 0;
        }
        .stat-card { 
            background: white; 
            padding: 30px; 
            border-radius: 10px; 
            text-align: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: transform 0.2s;
        }
        .stat-card:hover { transform: translateY(-5px); }
        .stat-number { 
            font-size: 3em; 
            font-weight: bold; 
            color: #667eea; 
            margin-bottom: 10px;
        }
        .stat-label { 
            color: #666; 
            font-size: 1.1em;
            font-weight: 500;
        }
        .nav-section { 
            background: white; 
            padding: 30px; 
            border-radius: 10px; 
            margin: 20px 0;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .nav-section h2 { 
            color: #333; 
            margin-top: 0; 
            margin-bottom: 20px;
            font-size: 1.5em;
        }
        .nav-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
            gap: 15px; 
        }
        .nav-item { 
            display: block; 
            padding: 15px 20px; 
            background: #667eea; 
            color: white; 
            text-decoration: none; 
            border-radius: 8px;
            text-align: center;
            transition: background 0.2s;
            font-weight: 500;
        }
        .nav-item:hover { 
            background: #5a6fd8; 
            text-decoration: none;
            color: white;
        }
        .nav-item.add { background: #28a745; }
        .nav-item.add:hover { background: #218838; }
        .nav-item.manage { background: #17a2b8; }
        .nav-item.manage:hover { background: #138496; }
        .footer {
            text-align: center;
            padding: 20px;
            color: #666;
            margin-top: 40px;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>🏭 MES制造执行系统</h1>
        <p>欢迎使用制造执行系统管理平台</p>
    </div>
    
    <div class="container">
        <div class="nav-section">
            <h2>🚀 快速导航</h2>
            <div class="nav-grid">
                <a href="/admin/" class="nav-item">管理后台</a>
                <a href="/mes/" class="nav-item">仪表板</a>
                <a href="/mes/api/stats/" class="nav-item">API数据</a>
            </div>
        </div>
        
        <div class="nav-section">
            <h2>📊 系统概览</h2>
            <div class="stats">
                <div class="stat-card">
                    <div class="stat-number">{{ total_customers }}</div>
                    <div class="stat-label">客户总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-number">{{ total_products }}</div>
                    <div class="stat-label">产品总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-number">{{ total_orders }}</div>
                    <div class="stat-label">订单总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-number">{{ total_equipment }}</div>
                    <div class="stat-label">设备总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-number">{{ total_employees }}</div>
                    <div class="stat-label">员工总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-number">{{ active_work_orders }}</div>
                    <div class="stat-label">活跃工单</div>
                </div>
            </div>
        </div>
        
        <div class="nav-section">
            <h2>➕ 快速添加</h2>
            <div class="nav-grid">
                <a href="/admin/simple_mes/customer/add/" class="nav-item add">添加客户</a>
                <a href="/admin/simple_mes/product/add/" class="nav-item add">添加产品</a>
                <a href="/admin/simple_mes/order/add/" class="nav-item add">创建订单</a>
                <a href="/admin/simple_mes/equipment/add/" class="nav-item add">添加设备</a>
                <a href="/admin/simple_mes/employee/add/" class="nav-item add">添加员工</a>
                <a href="/admin/simple_mes/workorder/add/" class="nav-item add">创建工单</a>
            </div>
        </div>
        
        <div class="nav-section">
            <h2>📋 业务管理</h2>
            <div class="nav-grid">
                <a href="/admin/simple_mes/customer/" class="nav-item manage">客户管理</a>
                <a href="/admin/simple_mes/product/" class="nav-item manage">产品管理</a>
                <a href="/admin/simple_mes/order/" class="nav-item manage">订单管理</a>
                <a href="/admin/simple_mes/equipment/" class="nav-item manage">设备管理</a>
                <a href="/admin/simple_mes/employee/" class="nav-item manage">员工管理</a>
                <a href="/admin/simple_mes/workorder/" class="nav-item manage">工单管理</a>
            </div>
        </div>
    </div>
    
    <div class="footer">
        <p>© 2024 MES制造执行系统 - 让制造更智能</p>
    </div>
</body>
</html> 